From 9767e05fcb2913a299e1521be3fddcd73f5aef6b Mon Sep 17 00:00:00 2001 From: Robert Lipe Date: Mon, 9 Dec 2019 09:41:57 -0600 Subject: [PATCH] Mechanically move protos and structs for units.cc from defs.h to units.h --- GPSBabel.pro | 1 + defs.h | 16 ---------------- kml.cc | 1 + units.cc | 3 ++- units.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 17 deletions(-) create mode 100644 units.h diff --git a/GPSBabel.pro b/GPSBabel.pro index bdb7b2f62..206e5c90b 100644 --- a/GPSBabel.pro +++ b/GPSBabel.pro @@ -137,6 +137,7 @@ HEADERS = \ session.h \ shapelib/shapefil.h \ strptime.h \ + units.h \ xcsv.h \ xmlgeneric.h \ zlib/crc32.h \ diff --git a/defs.h b/defs.h index c6e28db04..b80b26c7b 100644 --- a/defs.h +++ b/defs.h @@ -1252,22 +1252,6 @@ int parse_speed(const QString& str, double* val, double scale, const char* modul */ unsigned long get_crc32(const void* data, int datalen); -/* - * From units.c - */ -enum fmt_units { - units_unknown = 0, - units_statute = 1, - units_metric = 2, - units_nautical =3, - units_aviation =4 -}; - -int fmt_setunits(fmt_units); -double fmt_distance(double, const char** tag); -double fmt_altitude(double, const char** tag); -double fmt_speed(double, const char** tag); - /* * From nmea.c */ diff --git a/kml.cc b/kml.cc index f9d06f664..e53e117cf 100644 --- a/kml.cc +++ b/kml.cc @@ -53,6 +53,7 @@ #include "src/core/xmlstreamwriter.h" // for XmlStreamWriter #include "src/core/xmltag.h" // for xml_findfirst, xml_tag, fs_xml, xml_attribute, xml_findnext #include "xmlgeneric.h" // for cb_cdata, cb_end, cb_start, xg_callback, xg_string, xg_cb_type, xml_deinit, xml_ignore_tags, xml_init, xml_read, xg_tag_mapping +#include "units.h" // options static char* opt_deficon = nullptr; diff --git a/units.cc b/units.cc index bd2540484..746f55574 100644 --- a/units.cc +++ b/units.cc @@ -20,6 +20,7 @@ */ #include "defs.h" +#include "units.h" static int units = units_statute; @@ -132,4 +133,4 @@ fmt_speed(const double distance_meters_sec, const char** tag) } return d; -} +} \ No newline at end of file diff --git a/units.h b/units.h new file mode 100644 index 000000000..fec3ff673 --- /dev/null +++ b/units.h @@ -0,0 +1,47 @@ +/* + Display scaled distances in 'local' units. + + Copyright (C) 2006 Robert Lipe, robertlipe+source@gpsbabel.org + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + */ + + +#ifndef GPSBABEL_UNITS_H +#define GPSBABEL_UNITS_H + +/* + * From units.c + */ +enum fmt_units { + units_unknown = 0, + units_statute = 1, + units_metric = 2, + units_nautical =3, + units_aviation =4 +}; + +int fmt_setunits(fmt_units); + +double fmt_distance(double, const char** tag); + +double fmt_altitude(double, const char** tag); + +double fmt_speed(double, const char** tag); + +#include "defs.h" + +#endif //GPSBABEL_UNITS_H -- 2.30.2